<?php
$this->Html->scriptBlock($scriptDatePicker, array('inline' => false));
?>
<div class="title-body-content"><?php echo $title_for_layout; ?></div>
<?php
$formUrl = array('controller' => 'reconciliations', 'action' => 'edit');
echo $this->Form->create('Reconciliation', array('url' => $formUrl, 'type' => 'text'));
echo $this->Form->input('id');
?>
<div class="wrapper-form-broking clearfix">
    <div class="wrapper-broking-inquyri clearfix">
        <div class="wrapper-inquirer clearfix">
            <span class="sp-bank-title"><?php echo __('Name of Bank'); ?> (*):</span>
            <?php
            echo $this->Form->input('name_of_bank', array(
                'class' => 'inp-bank-name',
                'label' => false,
                'div' => false,)
            );
            ?>
        </div>

        <div class="wrapper-bank-content clearfix">
            <span class="sp-bank-title-bank-address"><?php echo __('Address of Bank'); ?> :</span>
            <?php
            echo $this->Form->textarea('address_of_bank', array(
                'class' => 'inp-contact-address',
                'style' => 'width: 300px;',
                'label' => false,
                'div' => false,)
            );
            ?>
        </div>
        
        <div class="wrapper-bank-content clearfix">
            <span class="sp-bank-title"><?php echo __('Bank Code'); ?> (*):</span>
            <?php
            echo $this->Form->input('bank_code', array(
                'class' => 'inp-bank-acc',
                'label' => false,
                'div' => false,)
            );
            ?>
        </div>
        
        <div class="wrapper-bank-content clearfix">
            <span class="sp-bank-title"><?php echo __('Branch Code'); ?> (*):</span>
            <?php
            echo $this->Form->input('branch_code', array(
                'class' => 'inp-bank-acc',
                'label' => false,
                'div' => false,)
            );
            ?>
        </div>
        
        <div class="wrapper-bank-content clearfix">
            <span class="sp-bank-title"><?php echo __('SWIFT'); ?> (*):</span>
            <?php
            echo $this->Form->input('swift_code', array(
                'class' => 'inp-bank-acc',
                'label' => false,
                'div' => false,)
            );
            ?>
        </div>  
        
        <div class="wrapper-bank-content clearfix">
            <span class="sp-bank-title"><?php echo __('Amount'); ?> (*):</span>
            <?php
            echo $this->Form->input('amount', array(
                'value' => number_format($this->request->data['Reconciliation']['amount'], 2),
                'class' => 'inp-bank-acc',
                'label' => false,
                'div' => false,)
            );
            ?>
            <?php
            echo $this->Form->input('Currency.Currency', array(
                'multiple' => false,
                'selected' => $this->request->data['Reconciliation']['currency_id'],
                'empty' => false,
                'label' => false,
                'div' => false,)
            );
            echo $this->Form->input('currency', array(
                'type' => 'hidden',
                'value' => $this->request->data['Reconciliation']['currency'],)
            );
            ?>
        </div>  
        <div class="wrapper-bank-content clearfix">
            <span class="sp-bank-title"><?php echo __('Reference of Transaction'); ?> (*):</span>
            <?php
            echo $this->Form->input('reference_of_transaction', array(
                'class' => 'inp-bank-acc',
                'label' => false,
                'div' => false,)
            );
            ?>
        </div>  
        
        <div class="wrapper-bank-content clearfix">
            <span class="sp-bank-title"><?php echo __('Date'); ?> (*):</span>
            <?php
            echo $this->Form->text('date', array(
                'value' => $this->Layout->formatDate($this->data['Reconciliation']['date']),
                'class' => 'sel-date',
                'readonly' => 'readonly',
                'label' => false,
                'div' => false,)
            );
            ?>
        </div> 
    </div>
</div>

<!-- HTML for buttom -form-->

<div class="wrapper-button-form">
    <div class="button-form">
        <div class="button-aihre button-blue"><a href="#" class="save">SAVE</a></div>
        <div class="button-aihre button-blue">
            <?php
            echo $this->Html->link(__('CANCEL'), array('plugin' => null, 'controller' => 'reconciliations', 'action' => 'index'));
            ?>
        </div>
    </div>
</div>
<?php
echo $this->Form->end();
?>
<?php
$validForm = "
    $(function(){
        $('a.save').click(function(){
            $('#ReconciliationAdminEditForm').submit();
        });
        $('select#CurrencyCurrency').change(function(){
            var sb = $('select#CurrencyCurrency option:selected');
            $('input#ReconciliationCurrency').val(sb.text());
        });
        $('#ReconciliationAmount').blur(function(){
            $('#ReconciliationAmount').formatCurrency();
        });
    });";
$this->Html->scriptBlock($validForm, array('inline' => false));
?>